package com.qf.smartplatform.mapper;/*
*王浩政 
*whz
2022/9/14
21:48
*小米商城
*/

import com.qf.smartplatform.pojo.SysCategory;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CategoryMapper {


    @Insert("INSERT INTO sys_category(category_name,tx_command,rx_command,command_name,create_by) VALUES(#{categoryName},#{txCommand},#{rxCommand},#{commandName},#{createBy}) ")
    void addCategory(SysCategory category);


    @Select("SELECT * FROM sys_category WHERE category_name=#{categoryName}")
    SysCategory findByCategoryName(String categoryName);

    @Update("UPDATE sys_category SET category_name=#{categoryName},tx_command=#{txCommand},rx_command=#{rxCommand},command_name=#{commandName},status=#{status},update_by=#{updateBy} WHERE c_id =#{cId}")
    void updateCategory(SysCategory category);

    @Select("SELECT * from sys_category")
    List<SysCategory> findAllCategories();
}











